package com.finna.tenant.service;

import com.alibaba.fastjson.JSON;
import com.finna.common.utils.ResponseResult;
import com.finna.tenant.controller.AccountController;
import com.finna.tenant.dto.AccountDTO.AccountCreateRequest;
import com.finna.tenant.dto.AccountDTO.AccountResponse;
import com.finna.tenant.entity.Account;
import com.finna.tenant.mapper.AccountMapper;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.time.LocalDateTime;

@SpringBootTest
@Slf4j
public class AccountTest{

    @Resource
    private AccountController accountController;
    @Resource
    private AccountMapper accountMapper;

    @Test
    public void testCreateAccount() {
        AccountCreateRequest request = AccountCreateRequest.builder()
                .name("zlp")
                .email("984025247@qq.com")
                .password("123456")
                .interfaceTheme("light")
                .interfaceLanguage("zh-CN")
                .timezone("Asia/Shanghai")
                .build();
        ResponseResult<AccountResponse> responseResult = accountController.addAccount(request);
        log.info("创建账号结果: {}", JSON.toJSONString(responseResult));

    }


}
